import React from 'react';
import ReactDOM from 'react-dom';

export default class Test extends React.Component {

  componentDidMount() {
    window[this.props.detail.componentKey] = {
      //组件更新
      updateData: () => {},
      //基础信息
      info: {
        name: "website-base-header",
        decoration: "官网-底座头部",
        remark: "官网头部组件，包含高低配置",
        version: "v1.0.0",
        terminal: "web",
        microCode: "",
        classifyCode: "e4b12e50da7111edaff425b0e69bd71f",
        norms: "3x3"
      },
      //扩展信息
      extend: {
        //比如默认数据
        defaultData: {
          style: {
            color: 40
          }
        }
      },
      //默认配置
      settings: {
        setBasis: [
          {
            type:  "input",
            label: "首页高度",
            key: ['style', 'color'],
            value: 'red'
          }],
        dataSource: [
          {
            type: 1,
            name: "courseList",
            data:[
              {
                link: "跳转链接",
                img: "步骤图片",
                base: "跳转的basename"
              }
            ]
          },
          {
            type: 2,  // 数据类型： 1本地数据，2:接口请求
            method: '请求方式  Get/Post',
            url:"请求地址",
            host: "请求域名",
            isToken: true
          }

        ]
      }
    };
  }

  render () {
    return (
      <div>
        Hello World
      </div>
    );
  }
}

// TODO 打包发布请删除此段代码，此处仅在开发模式用做预览。
ReactDOM.render(<Test />, document.getElementById('root'));
